<!DOCTYPE html>
<!--
Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
Click nbfs://nbhost/SystemFileSystem/Templates/Scripting/EmptyPHPWebPage.php to edit this template
-->
<html>
    <head>
        <meta charset="utf-8">
        <title></title>
    </head>
    <body>
       <?php
        $q=@$_POST['q'];
         $w=@$_POST['w']; 
         $e=@$_POST['e'];
          $r=@$_POST['r'];
        require ("common.php");
        $sql="INSERT INTO `course`( `courseName`, `courseCode`, `courseCredit`, `courseHour`) "
                . "VALUES ('$q','$w','$e','$r')";
        $rem=mysqli_query($link,$sql);
	if(mysqli_affected_rows($link)>0){
            
		echo "<script>alert('添加成功');</script>";
		echo "<script>location.href='.php';</script>";
        } else {
            
		echo "<script>alert('添加失败');</script>";
		echo "<script>location.href='.php';</script>";
        }
        
        ?>
    </body>
</html>
